#include<stdio.h>
int main()
{
    int n;
    while(1==scanf("%d",&n))
    {
        if(n==0)break;
        int a=n/100;
        int b=(n%100)/10;
        int c=n%10;
        if(n==a*a*a+b*b*b+c*c*c)
            puts("Yes");
        else
            puts("No");
    }
    return 0;
}
